package com.yyoa.util;

import java.util.Map;

import net.sf.json.JSONObject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings("rawtypes")
public class CommonUtil {
	protected static final Logger logger = LoggerFactory
			.getLogger(CommonUtil.class);

	public static Map jsonStringToMap(String json, Map classMap) {
		return (Map) JSONObject.toBean(JSONObject.fromObject(json), Map.class,
				classMap);
	}

	public static String jsonMapToString(Map jsonMap) {
		return JSONObject.fromObject(jsonMap).toString();
	}
}
